package com.hn.service.serviceImpl;

import com.hn.feign.RestCnUserClient;
import com.hn.model.CnUser;
import com.hn.service.CnUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

@Component
public class CnUserServiceImpl implements CnUserService {

    @Autowired
    private RestCnUserClient restCnUserClient;

    @Override
    public Integer addCnUser(@RequestBody CnUser cnUser) throws Exception {
        String id = "1";
        CnUser c = restCnUserClient.getCnUserById(id);
        return restCnUserClient.addUser(cnUser);
    }
}
